

/**
 * @author Team Awesome Express
 * @version 1.0
 */
public class PatientInvoice {
//    * The patient name, date of visit and doctor.
//	  * The itemized bill for services provided.
	/**
	 * Field name.
	 */
	private String name;

	/**
	 * Field date.
	 */
	private String date;

	/**
	 * Field doctor.
	 */
	private String doctor;

	/**
	 * Field treatRecord.
	 */
	private TreatmentRecord treatRecord;

	/**
	 * Constructor for PatientInvoice.
	 * @param treatRecord TreatmentRecord
	 */
	public PatientInvoice (TreatmentRecord treatRecord) {
		name = treatRecord.getPatientUsername(); // Should be name
		date = treatRecord.getCreationDate();
		doctor = treatRecord.getTreatingDoctor();
		this.treatRecord = treatRecord;
	}

	/**
	 * Method populateItemizedList.
	 * @return String
	 */
	public String populateItemizedList(){
		String listOfItems = "";
		final int [] itemsIncluded = treatRecord.getBillablesReceived(treatRecord.getLabWork());
		for (int i=0; i < GlobalVars.BillableItems.length;i++){
			if (itemsIncluded[i] == 1){
				listOfItems = listOfItems + GlobalVars.BillableItems[i].getName() + ": $" + GlobalVars.BillableItems[i].getCost() + "\n";
			}
		}
		listOfItems = listOfItems + "---Total: $" + treatRecord.calculateBillables();
		return listOfItems;
			
		
	}

	/**
	
	 * @return the name */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	
	 * @return the date */
	public String getDate() {
		return date;
	}

	/**
	 * @param date the date to set
	 */
	public void setDate(String date) {
		this.date = date;
	}

	/**
	
	 * @return the doctor */
	public String getDoctor() {
		return doctor;
	}

	/**
	 * @param doctor the doctor to set
	 */
	public void setDoctor(String doctor) {
		this.doctor = doctor;
	}
}
